package com.ctv.my.customview.MaiCustomView;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.ctv.my.customview.MaiCustomView.CanvasDraw.DrawLineActivity;
import com.ctv.my.customview.MaiCustomView.CitySelector.CitySelectorActivity;
import com.ctv.my.customview.MaiCustomView.WaveSphericalView.WaveSphericalActivity;
import com.ctv.my.customview.R;

/**
 * Created by ms on 2017/8/4.
 */

public class MaiActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btnCity, btnWave,btnDraw;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mai);
        init();
    }

    private void init() {
        initView();
        initEvent();
    }

    private void initView() {
        btnCity = (Button) findViewById(R.id.btn_city_selector);
        btnWave = (Button) findViewById(R.id.btn_wave);
        btnDraw = (Button)findViewById(R.id.btn_draw_line);
    }

    private void initEvent() {
        btnCity.setOnClickListener(this);
        btnWave.setOnClickListener(this);
        btnDraw.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.btn_city_selector:
                intent.setClass(this, CitySelectorActivity.class);
                break;
            case R.id.btn_wave:
                intent.setClass(this, WaveSphericalActivity.class);
                break;
            case R.id.btn_draw_line:
                intent.setClass(this, DrawLineActivity.class);
                break;
        }
        startActivity(intent);
    }
}
